<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.changePasswordTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <!--<h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>-->
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle.oldPassword}:" for="oldPassword"/>
                    <h:inputSecret id="oldPassword" title="#{bundle.oldPassword}" required="true" requiredMessage="#{bundle.OBLIG}" validator="passwordMatchesOldPassword">
                    <f:ajax event="change"
                        execute="@this"
                        render="oldPasswordError" />
                    </h:inputSecret>
                    <h:message for="oldPassword" id="oldPasswordError"/>
                    <h:outputLabel value="#{bundle.newPassword}:" for="password"/>
                    <h:inputSecret id="password" value="#{usersController.selected.password}" title="#{bundle.newPassword}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:message for="password" id="passwordError"/>
                    <h:outputLabel value="#{bundle.repeatPassword}:" for="password2"/>
                    <h:inputSecret id="password2" title="#{bundle.repeatPassword}" required="true" requiredMessage="#{bundle.OBLIG}" validator="passwordEqualsValidator"/>
                    <h:message for="password2" id="password2Error"/>
                </h:panelGrid>
                <h:commandLink action="#{usersController.update}" value="#{bundle.changePassword}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
